#include "Reactor.hpp"
#include "Listener.hpp"
#include <iostream>
#include <memory>

int main(int argc, char *argv[])
{
    if(argc != 2)
    {
        std::cout << "Usage: " << argv[0] << " port" << std::endl;
        return 1;
    }
    ENABLE_CONSOLE_LOG();
    uint16_t local_port = std::stoi(argv[1]);

    auto coon = std::make_shared<Listener>(local_port);

    std::unique_ptr<Reactor> ssvr = std::make_unique<Reactor>();//创建Reactor模块
    ssvr->InsertConnection(coon);//将listener插入

    ssvr->Loop();

    return 0;
}